<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href="__ROOT__/Public/admin/css/style.css" rel="stylesheet">
<link href="__ROOT__/Public/admin/css/font-awesome.min.css" rel="stylesheet">
<link href="__ROOT__/Public/plugin/select2/select2.css" rel="stylesheet">
<script src="__ROOT__/Public/admin/laydate/laydate.js"></script>
<title>资料列表</title>
</head>
<style>
.page {
    margin: 10px 0;
    *zoom: 1;
}
.page:before,
.page:after {
    display: table;
    content: "";
}
.page:after {
    clear:both;
}
.page a,
.page span {
    float: left;
    margin-left: -1px;
    padding: 0 14px;
    height: 30px;
    line-height: 30px;
    color: #000;
    border-top: 1px solid #CCCCCC;
    border-bottom: 1px solid #CCCCCC;
    /*background-color: #4bbd00;*/
}
.page a:hover
 {
    text-decoration: none;
    background-color: #387C0B;
}
.page .current {
	border-top: 1px solid #387C0B;
}
.page .next,
.page .prev {
    font-family: "宋体";
    font-weight: bold;
}
.page .rows {
	border-right: 1px solid #CCCCCC;
}
.page .rows {
	border-right: 1px solid #CCCCCC;
}

</style>
<body>
	<div id="show">
		<div class="breadNav">
			<ul class="breadNavBar">
				<li><i class="icon-home"></i></li>
				<li><a href="#">首页</a></li>
				<li>&gt;</li>
				<li><a href="#">考试资料</a></li>
				<li>&gt;</li>
				<li><a href="#" class="active">{$title}</a></li>
			</ul>
		</div>
		<div style="clear:both;"></div>
		  <div class="filter">
		<div class="form-group">
            <a class="btn btn-primary btn-lg" id="addBtn" href="__ROOT__/Admin/Reference/reference_cata_list/level_one/1"><i class="icon-reply"></i>&nbsp;返回</a>
        </div>
        <div class="form-group" style="margin-left:50px;">
            <a class="btn btn-primary btn-lg" id="addBtn" href="__ROOT__/Admin/Reference/add_pa/type/{$type}/level_one_hid/{$level_one_hid}"><i class="icon-plus"></i>&nbsp;添加资料</a>
        </div>
        <div class="form-group" style="margin-left:50px;">
            <a class="btn btn-primary btn-lg" id="addBtn" href="__ROOT__/Admin/Reference/edit_price/type/{$type}/level_one_hid/{$level_one_hid}"><i class="icon-plus"></i>&nbsp;设置该分类下面资料价格</a>
        </div>
        <div class="form-group" style="margin-left:50px;">
            <a class="btn btn-primary btn-lg" id="addBtn" href="__ROOT__/Admin/Reference/referenceType_list/type/{$type}"></i>&nbsp;资料类型列表</a>
        </div>
        </div>
        <div style="clear:both;"></div>
        <form action="" method="post">
		<table class="table">
			<thead>
				<tr>
				    <th width="3%"></th>
					<th colspan="6">资料名</th>
					<th >操作</th>
				</tr>
			</thead>
			
			<tbody id="dataInfo">
				<volist name="reference_List" id="vb">
				<tr>
				  <td ><input type="checkbox" name="id[]" value="{$vb.id}"></td>
				  <td colspan="6" align="left">{$vb.name}</td>
				  <td name="de">
						<a class="btn btn-table" href="__ROOT__/Admin/Reference/edit_reference/id/{$vb.id}/type/{$type}"><i class="icon-edit"></i>&nbsp;编辑</a>
						<a class="btn btn-table" href="__ROOT__/Admin/Reference/delete_single/id/{$vb.id}" name='delete_single'><i class="icon-remove"></i>&nbsp;删除</a>
				  </td>
				</tr>
				</volist>
				<tr>
					<td><input type="checkbox" id="areaSelAll"></td>
					<td align="left" colspan="13"><a name='delete_all' class="btn btn-table" href="javascript:;" class="allDel"><i class="icon-trash"></i>&nbsp;批量删除</a></td>
				</tr>
			</tbody>
		</table>
        </form>
	</div>
	<div class="page">
        {$page}
	</div>
</body>
<script src="__ROOT__/Public/js/jquery.min.js?ver=1.8.3"></script>
<script src="__ROOT__/Public/admin/js/main.js"></script>
<script src="__ROOT__/Public/js/titleMes.js"></script>
<script src="__ROOT__/Public/plugin/select2/select2.min.js"></script>
<script>
$('a[name=delete_single]').click(function(){
	     if(confirm('确认要删除吗？')){
	    	return true;
	     }
	     else return false;
});

$('a[name=delete_all]').click(function(){
    if(confirm('确认要删除吗？')){
  	   var d=$("input[type=checkbox][name='id[]']:checked");
  	   var v='';
  	   for(var i = 0; d && i < d.length; i++) {  
  	          v += $(d[i]).val()+'@';  
  	    }
  	   if(v!=''){
  	   $.get("__ROOT__/Admin/Reference/delete_all",{ids:v},function(data){
  	      if(data==true){
  	    	 $("input[type=checkbox][name='id[]']:checked").parent().parent().remove();
  	      }
  	  });
  	   }
    }
    else return false;
});


</script>
</html>
